package com.note.simpleadmin.entity;

import javax.persistence.*;
import java.util.Objects;

/***
 *@ClaseName:BgUser
 *
 *@Decription:
 *
 *@Author: xubingbing
 *
 *@Date:2019/1/27 0027 14:14
 */
@Entity
@Table(name = "bg_user", schema = "simpleshop", catalog = "")
public class BgUser {
    private String id;
    private String username;
    private String pwd;
    private String phone;
    private String role;
    private String salt;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "pwd")
    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Basic
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "role")
    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }
    @Basic
    @Column(name = "salt")
    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BgUser bgUser = (BgUser) o;
        return id == bgUser.id &&
                Objects.equals(username, bgUser.username) &&
                Objects.equals(pwd, bgUser.pwd) &&
                Objects.equals(phone, bgUser.phone) &&
                Objects.equals(role, bgUser.role)&&
                Objects.equals(salt, bgUser.salt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, pwd, phone, role);
    }
}
